package org.gd.redis.local;

import java.util.Map;

public class LocalRedis {

    private static LocalRedisContainer container;

    static {
        container = new LocalRedisContainer();
    }

    private LocalRedis() {}

    public synchronized static void set(String session, String key, String value) {
        container.set(session, key, value);
    }

    public synchronized static void set(String session, String key, String value, Integer expireSec) {
        container.set(session, key, value, expireSec);
    }

    public synchronized static String get(String session, String key) {
        return container.get(session, key);
    }

    public synchronized static String iGet(String session, String key) {
        return container.iGet(session, key);
    }

    public synchronized static Map<String, String> getAll(String session) {
        return container.getAll(session);
    }

    public synchronized static Map<String, String> iGetAll(String session) {
        return container.iGetAll(session);
    }

    public synchronized static boolean isExists(String session) {
        return container.isExists(session);
    }

    public synchronized static boolean isEmpty(String session) {
        return container.isEmpty(session);
    }

    public synchronized static void del(String session) {
        container.del(session);
    }

    public synchronized static int hincrBy(String session, String key, int increment) {
        return container.hincrBy(session, key, increment);
    }
}
